/*
 * Title:        CloudScheduler Toolkit
 * Description:  a Toolkit for Modeling and Simulation of Job Scheduling and Resource Provisioning in Cloud System
 * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html
 * Author:       Fuhui Wu
 *
 * Copyright (c) 2013-2014, The National University of Defense Technology, China
 */

package org.nudt.jCloud.infrastructure;

public class StorageProvisioner {
	private int storage;
	private int availableStorage;

	public StorageProvisioner(int storage) {
		setStorage(storage);
		setAvailableStorage(storage);
	}
	
	public void reset(){
		setAvailableStorage(storage);
	}

	public void occupy(int length){
		setAvailableStorage(availableStorage-length);
	}
	
	/**
	 * @return the storage
	 */
	public long getStorage() {
		return storage;
	}

	/**
	 * @param storage the storage to set
	 */
	public void setStorage(int storage) {
		this.storage = storage;
	}

	/**
	 * @return the availableStorage
	 */
	public int getAvailableStorage() {
		return availableStorage;
	}

	/**
	 * @param availableStorage the availableStorage to set
	 */
	public void setAvailableStorage(int availableStorage) {
		this.availableStorage = availableStorage;
	}

}
